#ifndef BUFFER_H_
#define BUFFER_H_

#define BUFFER_SIZE 25
#define ERROR_CHAR (-1)

typedef struct {
  char* data;
  int   begin;
  int   end;
  int   available;
  int   size;
} buffer_t;

buffer_t buffer_create(char* ptr, int size);
void buffer_put(buffer_t* buf, char c);
char buffer_get(buffer_t* buf);
void buffer_flush(buffer_t* buf);

 

#endif /* BUFFER_H_ */